package com.petAdoption.manager.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.petAdoption.manager.entity.Examinedeliver;
import com.petAdoption.manager.mapper.ExaminedeliverMapper;
import com.petAdoption.manager.service.IExaminedeliverService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.petAdoption.manager.vo.ExaminedeliverVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 王倩茹
 * @since 2023-08-28
 */
@Service
public class ExaminedeliverServiceImpl extends ServiceImpl<ExaminedeliverMapper, Examinedeliver> implements IExaminedeliverService {
    @Resource
    private ExaminedeliverMapper deliver;
    @Override
    public List<ExaminedeliverVO> findAll() {
        return deliver.findAll();
    }


    @Override
    public int  updateStatus(Examinedeliver examinedeliver){
        int examinedeliverStatus = deliver.update(examinedeliver, new UpdateWrapper<Examinedeliver>().set("examinedeliver_status", examinedeliver.getExaminedeliverStatus()).eq("examinedeliver_id",examinedeliver.getExaminedeliverId()));
        return examinedeliverStatus;
    }

    @Override
    public List<ExaminedeliverVO> findByStatus(Integer examinedeliverStatus) {
        return deliver.findByStatus(examinedeliverStatus);
    }

}
